//
//  ContributionListViewController.swift
//  SmartHousekeeper
//
//  Created by 张磊 on 2020/2/21.
//  Copyright © 2020 LS. All rights reserved.
//

import UIKit
//缴费列表
class ContributionListViewController: ContributionBaseViewController {
    let contributionListView = ContributionListView()
    override func rightBtnAction() {
        print("更多")
    }
    override func viewDidLoad() {
        super.viewDidLoad()

        setUI()
      
    }
    func setUI()  {
        self.baseView.addSubview(contributionListView)
        contributionListView.snp.makeConstraints { (make) in
            make.top.equalTo(self.baseView.rightBtn.snp.bottom);
            make.left.equalToSuperview();
            make.right.equalToSuperview();
            make.bottom.equalTo(self.baseView.company.snp.top);
        }
        contributionListView.selectBankBlock = {
            print("选择银行")
        }
        contributionListView.switchBlock = { isOn in
            print("开关 = \(isOn)")
            
        }
        contributionListView.didSelectTableViewBlock = { indexPath in
            print("tableview 选中\(indexPath)")
            self.contributionListViewdidSelectTableViewAction(indexPath as IndexPath)
        }
    }
        
    
    func contributionListViewdidSelectTableViewAction(_ indexPath : IndexPath) {
        switch indexPath.row {
        case 0://物业费缴费
        let vc = PropertyExpensesViewController()
        self.navigationController?.pushViewController(vc, animated: true)
            break
        default:
            break
        }
    }
   

}
